/* Base abstarct all rendered Objects will inherit from.
List: PhysicsObjects, Terrian
*/
#pragma once
#include <d3d9.h>
#include <d3dx9tex.h>
#include <string>
#include "Telegram.h"

//Forward Declare for Model
class Model;

enum { MSG_COLLIDE, 
	   MSG_PROJECTILE, 
	   MSG_ATK, 
	   MSG_PRJCOLLIDE, 
	   MSG_ATKCOLLIDE, 
	   MSG_AWARE, 
	   MSG_ATK_AWR };

class GameObject
{
private:
	//TODO: Implement id system for AI
	int				m_ID;
	static int      m_iNextValidID;
	//private Set Id function to insure 
	// Ids are set correctly and only in baseEntity 
	void SetID(int a_val);

protected:

	// A pointer to a model object
	Model			*m_Model;
	float m_size;	//scale

public:

	GameObject(int id);
	virtual ~GameObject();
	int	ID()const{return m_ID;}
	void setSize(float a_size){m_size=a_size;}
	float getSize(){return m_size;}

	// Abstract methods, must be overridden
	virtual void update(float)=0;
	virtual bool create(LPDIRECT3DDEVICE9 device, std::string modelName) = 0;
	virtual void render(LPDIRECT3DDEVICE9 device) = 0;
	virtual float getXPosition()=0;
	virtual float getYPosition()=0;
	virtual float getZPosition()=0;

	virtual float getXRotation()=0;
	virtual float getYRotation()=0;
	virtual float getZRotation()=0;

	virtual bool  HandleMessage(const Telegram& msg)=0;

};